package com.lancoo.cvas.pojo.request;

import cn.hutool.core.util.IdUtil;
import com.lancoo.cvas.util.MD5Util;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @ClassName NewMessage
 * @Description 消息系统推送消息内容
 * @Author quin
 * @Date 2023/4/19 14:47
 */
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class NewMessage {

    private String sysId;
    private String secCode;
    private String eventId;
    private String msgId;
    private String templateId;
    private String templateParam;
    private String msgType;
    private String pcLink;
    private String pcLinkType;
    private String appletsParam;
    private String appParam;
    private String remindTime;
    private String expireTime;
    private String receiverType;
    private String userId;
    private String userName;
    private Integer userType;
    private String identityCode;
    private Integer noticeType;
    private String schoolId;
    private List<UserInfo> sendObject;


    @Data
    @Builder
    public static class UserInfo {
        private String userId;
        private String userName;
        private Integer userType;
    }

    public static NewMessage getMessageTemple() {
        return NewMessage.builder()
                .secCode(MD5Util.MD5encryptRevs("E31"))
                .sysId("E31")
                .msgId(IdUtil.randomUUID())
                .msgType("1")
                .expireTime("")
                .pcLink("?lg_tk=[token]&lg_ic=[IdentityCode]#/")
                .pcLinkType("1")
                .appletsParam("")
                .appParam("")
                .remindTime("")
                .expireTime("")
                .receiverType("0")
                .identityCode("")
                .noticeType(0)
                .build();
    }
}
